/**  
* @author renbangjie renbangjie@126.com  
* @date 2014-11-12 上午10:41:21
* @version V1.0  
* <b>Copyright (c)</b> 2014医信金融信息服务（上海）有限公司-版权所有<br/>
*/
package com.yjd.comm.enums;

/**
 * 银行相关的枚举
 * @author renbangjie renbangjie@126.com
 * @date 2014-11-12 上午10:41:21
 */
public class BankEnums {

	/**
	 * 银行状态
	* @author renbangjie renbangjie@126.com
	* @date 2014-11-12 上午10:42:20
	 */
	public enum BankStatus {

		enabled(1, "有效"),
		disable(2, "无效"),
		isAuthen(1, "银行卡已认证"),
		noAuthen(0, "银行卡未无效");
		
		private BankStatus(int code, String label) {
			this.code = code;
			this.label = label;
		}
		
		public static BankStatus getInstance(Integer code){
			for (BankStatus status : BankStatus.values()) {
				if(status.getCode() == (int)code){
					return status;
				}
			}
			return null;
		}
		

		private int code;
		
		private String label;

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getLabel() {
			return label;
		}

		public void setLabel(String label) {
			this.label = label;
		}
	}
	
	/**
	 * 银行类型(是否支持企业银行)
	* @author renbangjie renbangjie@126.com
	* @date 2014-11-12 上午10:42:28
	 */
	public enum EnterpriseBankStatus {

		support(2, "支持"),
		nonsupport(1, "不支持");
		
		private int code;
		
		private String label;
		
		private EnterpriseBankStatus(int code, String label){
			this.code = code;
			this.label = label;
		}
		
		
		public static EnterpriseBankStatus parse(Integer code){
			if(code == null){
				return null;
			}
			for (EnterpriseBankStatus status : EnterpriseBankStatus.values()) {
				if(status.getCode() == (int)code){
					return status;
				}
			}
			return null;
		}
		

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getLabel() {
			return label;
		}

		public void setLabel(String label) {
			this.label = label;
		}
		
	}
	
	
	public enum BankType {

		normal(1, "个人网银"),
		enterpriseBank(2, "企业网银");
		
		private int code;
		
		private String label;
		
		private BankType(int code, String label){
			this.code = code;
			this.label = label;
		}
		
		
		public static BankType parse(Integer code){
			if(code == null){
				return null;
			}
			for (BankType status : BankType.values()) {
				if(status.getCode() == (int)code){
					return status;
				}
			}
			return null;
		}
		
		
		public static BankType getBankType(int idBank){
			if(idBank <= 100){
				return BankType.normal;
			}
			return BankType.enterpriseBank;
		}
		

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getLabel() {
			return label;
		}

		public void setLabel(String label) {
			this.label = label;
		}
		
	}
	
	/**
	 * 快捷支付相关
	* @author renbangjie renbangjie@126.com
	* @date 2015-10-10 上午9:37:44
	 */
	public enum QuickAuth {
		
		//银行卡是否支持快捷支付
		nonsupport(0, "不支持快捷支付"),
		support(1, "支持快捷支付"),
		//认证类型
		pay(1, "支付认证"),
		normal(0, "直接认证");
		
		private int code;
		private String label;
		
		private QuickAuth(int code, String label) {
			this.code = code;
			this.label = label;
		}
		public int getCode() {
			return code;
		}
		public void setCode(int code) {
			this.code = code;
		}

		public String getLabel() {
			return label;
		}

		public void setLabel(String label) {
			this.label = label;
		}
		
	}
	
	
	
}
